﻿// CheckCaseListCtrl.cpp: 实现文件
//

#include "stdafx.h"
#include "zChecker.h"
#include "CheckCaseListCtrl.h"

#include "ckEnumCheckCase.h"


// CCheckCaseListCtrl

IMPLEMENT_DYNAMIC(CCheckCaseListCtrl, CListCtrl)

CCheckCaseListCtrl::CCheckCaseListCtrl()
{

}

CCheckCaseListCtrl::~CCheckCaseListCtrl()
{
}


BEGIN_MESSAGE_MAP(CCheckCaseListCtrl, CListCtrl)
END_MESSAGE_MAP()



// CCheckCaseListCtrl 消息处理程序

void CCheckCaseListCtrl::Populate()
{
	ck::CheckCase* pCase = NULL;
	ck::EnumCheckCase* pCases = NULL;
	ck::CheckCaseManager* pCaseManager = ck::CheckCaseManager::GetInstance();

	DeleteAllItems();

	pCases = pCaseManager->GetCases();
	pCases->Reset();
	while ((pCase = pCases->Next()))
	{
		int nItem = InsertItem(GetItemCount(), pCase->GetName(), 0);
		SetItemData(nItem, pCase->GetCode());
	}
	pCases->Release();
}
